package edu.tgc.custom;

import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;

public class EasyuiSort {

    private String order;
    private String sort;

    public Sort buildSort() {
        return new Sort(this.order.equals("asc") ? Direction.ASC : Direction.DESC, this.sort);
    }

    public String getOrder() {
        return this.order;
    }

    public String getSort() {
        return this.sort;
    }

    public void setOrder(String order) {
        this.order = order;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }

}
